<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>优惠券</title>
<meta name="viewport" content="width=100%, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/lib/weix/style/weui.min.css">
<link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/comm.css">
<link rel="stylesheet" href="/css/code_yhq.css">
</head>

<body>
<div class="body_bj"></div>

<div style="position:relative; padding:30px 20px 0; color:#fff; text-align:center">恭喜您获得一张<span id="J_leix">---</span></div>

<div class="code-boxs">
	<div class="code-tit" id="J_tit_box">
    	<p style="padding-bottom:5px; color:#ff1600; font-size:50px;" id="J_youh">---</p>
        <p style="color:#ff1600; font-size:14px;">单笔消费满<span id="J_manz">--</span>可使用<br />截止<span id="J_time">----</span>(含)有效</p>
    </div>
    <div class="code-x"><img src="/images/code_x.png" /></div>
    <div class="code-ma">
    	<div class="code-ma__erw" id="J_ewm"></div>
        <div class="code-ma__tis">
        	<p style="padding:20px 0 5px; font-size:17px;">购物结算是出示该优惠券</p>
            <p style="color:#ccc;">*指定商品除外，以实际销售场景为准</p>
        </div>
    </div>
</div>

<div class="code-smboxs">
    <div class="code-smbox">
        <div class="code-sm__tao"><span class="tb"><i class="icon-home"></i></span><p class="wz">东鹏瓷砖禅城区兴隆店</p></div>
        <div class="code-sm__tao"><span class="tb"><i class="icon-position"></i></span><p class="wz">禅城区张槎一路禅城区张槎一路157号（大布路公交站对面）</p></div>
        <div class="code-sm__tao"><span class="tb"><i class="icon-phone"></i></span><p class="wz"><a href="tel:13955474457">13955474457（点击拨号咨询）</a></p></div>
    </div>
</div>

<script src="/js/zepto.min.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
<script src="/js/comm.js"></script>
<script type="text/javascript">
$(function(){	
	var data = {id:'${id}'};
	var url = "/customer/CouponDetail";
	$.ajax({
		type: "POST",
		dataType: 'json',
		async: false,
		contentType: "application/json; charset=utf-8",
		data: JSON.stringify(data),
		url: url,
		success: function(res){
			var datas=res.data
			if(res.code == 200){
				
				if(datas.discount_type == 0){  						//0满减 1折扣
					$('#J_leix').html('满减券')
					$('#J_youh').html('￥'+datas.discount)				//优惠
				}else if(datas.discount_type == 1){
					$('#J_leix').html('折扣券')
					$('#J_youh').html(datas.discount+'<span style="font-size:24px;">折</span>')	//优惠
				}
				
				$('#J_ewm').html('<img src="'+datas.qrcode+'" />')	//二维码
				$('#J_manz').html(datas.full)						//满多少
				$('#J_time').html(datas.overtime)					//截止日期

				if(datas.status==1){							//是否使用 0未核销  1过期  2已核销
					$('#J_tit_box').append('<div class="th-info__zhang on"><i class="icon-zhang"></i><span class="z">已过期</span></div>')
				}else if(datas.status==2){
					$('#J_tit_box').append('<div class="th-info__zhang"><i class="icon-zhang"></i><span class="z">已使用</span></div>')
				}
				
			}else{
				weui.topTips(res.msg);
			}
		},
		error: function(e){

		},
		complete: function(e){
		}
	});
	
	
});
</script>
</body>
</html>